var app = getApp();
Page({
  data: {
    oid: '',
    detail:[],
    allprice:0
  },
  onLoad(options) {
    var that = this; 
    //获取传递的参数
    this.setData({
      oid: options.oid
    })
    this.getdata();
  },
  getdata: function () {
    var that = this;
    wx.request({
      url: app.myUlife.ulifeUrl + '/wechart/getOrderInfoByid.html',
      data: {
        oid: that.data.oid
      },
      header: {
        "Content-Type": "applciation/json"
      },
      method: "GET",
      success: function (res) {
        var detail=res.data;
        var allprice=0;
        for (var i = 0; i < detail.length;i++){
          allprice = allprice + parseFloat(detail[i].FY);
        }
        that.setData({
          detail: detail,
          allprice: allprice
        });
      },
      fail: function (err) { },
      complete: function () { }
    })
  },
  toMyservice: function () {
    wx.redirectTo({
      url: '../../pages/order/list/index'
    })
  },
  tohomepage: function () {
    wx.switchTab({
      url:'../../pages/home/home'
    })
  }
})